﻿using System.Collections.Generic;
using System.Linq;
using FitNesseRunner.Model;

namespace FitNesseRunner
{
	public class ImportTable
	{
		private readonly IEnumerable<string> _imports;

		public ImportTable(IEnumerable<IEnumerable<string>> cells)
		{
			_imports = from row in cells.Skip(1)
			           select row.Single();
		}

		public void ExecuteAll(IContext context)
		{
			context.AddImports(_imports);
		}
	}
}